package com.awenhui.demo.config.properties;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.core.io.Resource;
import org.springframework.stereotype.Component;

/**
 * @author yuxf
 * @version 1.0
 * @date 2021/6/29 14:36
 */
@Component
@ConfigurationProperties(prefix = "app")
@Data
public class AppProperty {

    /**
     * 运行环境
     */
    @Value("${spring.profiles.active}")
    private String active = "dev";

    /**
     * 服务名称
     */
    @Value("${spring.application.name}")
    private String serviceName;

    /**
     * 当前配置文件路径
     */
    @Value(value = "classpath:application-${spring.profiles.active}.yml")
    private Resource resource;

    /**
     * 是否生成外置配置文件
     */
    private boolean createOutConf = false;


    /**
     * header token key
     */
    private String tokenHeaderKey = "Authorization";
}
